﻿@using Covenant.Models.Grunts
@using Covenant.Models.Listeners
@{
    Layout = "_Layout";
    ViewData["Title"] = "Dashboard";
    IEnumerable<Grunt> Grunts = ViewBag.Grunts;
    IEnumerable<Listener> Listeners = ViewBag.Listeners;
    IEnumerable<GruntTasking> GruntTaskings = ViewBag.GruntTaskings;
}

<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3">
    <h1 class="h2">Dashboard</h1>
</div>

<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center">
    <h4 class="h5">Grunts</h4>
</div>

@{
    await Html.RenderPartialAsync("../Grunt/_GruntTable", Grunts);
}
<br/>
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center">
    <h4 class="h5">Listeners</h4>
</div>

@{
    await Html.RenderPartialAsync("../Listener/_ListenerTable", Listeners);
}
<br/>
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center">
    <h4 class="h5">Taskings</h4>
</div>

@{
    await Html.RenderPartialAsync("../GruntTasking/_GruntTaskingTable", GruntTaskings);
}
<br/>
@section Scripts {
    <script type="text/javascript">
        $(document).ready(function () {
            $('#grunt-table').DataTable({
                "pageLength": 5,
                "lengthChange": false,
                "searching": false,
                "info": false,
                "order": [[ 5, "desc" ]]
            });
            $('#tasking-table').DataTable({
                "pageLength": 5,
                "lengthChange": false,
                "searching": false,
                "info": false,
            });
        });
    </script>
}